<template>
  <div class="my-income-layout">
    <snackbar style-color="#4A4A4A"
              back-color="#ffffff"
              status-color="#ffffff"
              :fixed="true">
      <template slot="slot">
        <div class="top-layout">
          <van-tabs class="tebs-layout" v-model="active" animated color="#64C367"
                    title-inactive-color="#999999"
                    title-active-color="#44C8CD"
                    line-height="0"
                    :ellipsis="false"
                    :line-width="getAdaptiveSize(50)+'px'"
                    @click="clickSelect"
          >
            <van-tab title="全部"></van-tab>
            <van-tab title="1月"></van-tab>
            <van-tab title="2月"></van-tab>
            <van-tab title="3月"></van-tab>
            <van-tab title="4月"></van-tab>
            <van-tab title="5月"></van-tab>
            <van-tab title="6月"></van-tab>
            <van-tab title="7月"></van-tab>
            <van-tab title="8月"></van-tab>
            <van-tab title="9月"></van-tab>
            <van-tab title="10月"></van-tab>
            <van-tab title="11月"></van-tab>
            <van-tab title="12月"></van-tab>
          </van-tabs>
          <div class="siftingSe" :class="{'boderAll':isShow}">
            <div @click="clickShow">筛选</div>
          </div>
          <div class="siftingSelect" v-show="isShow">
            <div v-for="item in list" class="txtTime">
              <div>{{ item.txt }}:{{ item.time }}</div>
            </div>
            <div class="btm_con">
              <div class="reset">重置</div>
              <div class="submit" @click="submit">确定</div>
            </div>
          </div>
        </div>
      </template>
    </snackbar>
    <div class="bottom-layout">
      <span class="rests-btn">其他</span>
      <span class="add-btn">新增</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'income',
  data() {
    return {
      active: null,
      list: [{
        txt: '选择开始时间',
        time: '2021-5-31'
      }, {
        txt: '请选择结束时间',
        time: '2021-5-31'
      }],
      isShow: false
    }
  },
  methods: {
    clickShow() {
      this.isShow = !this.isShow
    },
    submit() {
      this.isShow = !this.isShow
    }
  }
}
</script>

<style lang="scss" scoped>

.my-income-layout {
  .top-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100vw;
    height: 7.2vh;
    background-color: white;
    position: relative;

    .tebs-layout {
      width: 85%;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      border-bottom: 1px solid rgba(219, 219, 219, 0.5);
    }

    .siftingSe {
      width: 15%;
      height: 100%;
      font-size: 0.4rem;
      display: flex;
      justify-content: center;
      align-items: center;
      border-bottom: 1px solid rgba(219, 219, 219, 0.5);
    }

    .siftingSelect {
      width: 100vw;
      position: absolute;
      top: 100%;
      background-color: #FFFFFF;
      border-top: none;
      border-left: none;
      border-right: none;
      border-bottom: 1px solid rgba(219, 219, 219, 0.5);
      z-index: 1;

      .txtTime {
        margin: 10%;
        font-size: 0.6rem;
      }

      .btm_con {
        width: 100%;
        border-top: 1px solid #999898;
        display: flex;

        .reset {
          width: 50%;
          margin: 4% 0;
          text-align: center;
          border-right: 1px solid #999898;
          font-size: 0.5rem;
        }

        .submit {
          width: 50%;
          text-align: center;
          margin: 4% 0;
          font-size: 0.5rem;
        }
      }
    }
  }

  .bottom-layout {
    position: fixed;
    bottom: 0px;
    width: 100vw;
    height: 47px;
    display: flex;
    flex-direction: row;


    .rests-btn {
      width: 121px;
      height: 47px;
      background: #FFFFFF;
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      border-top: 1px solid rgba(221, 220, 220, 0.5);
      font-size: 14px;
      color: #3A3A3A;
    }

    .add-btn {
      flex: 1;
      height: 47px;
      background: linear-gradient(221deg, #7ED785 0%, #64C367 100%);
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;

      font-size: 14px;
      color: #FFFFFF;
    }
  }
}

.boderAll {
  border-top: 1px solid rgba(219, 219, 219, 0.5);
  border-left: 1px solid rgba(219, 219, 219, 0.5);
  border-bottom: none !important;
  border-right: none;
}
</style>
